Strict

Import nrgsMonkeyLib.php

Function Main:Int()
	Print "php Test 1~n"
	
	' substr Tests
	Print "substr examples"
	
	Print "~nExample 1"
	Print "A: " + substr( "abcdef", -1 )
	Print "B: " + substr( "abcdef", -2 )
	Print "C: " + substr( "abcdef", -3, 1 )
	
	Print "~nExample 2"
	Print "A: " + substr( "abcdef", 0, -1 )
	Print "B: " + substr( "abcdef", 2, -1 )
	Print "C: " + substr( "abcdef", 4, -4 )
	Print "D: " + substr( "abcdef", -3, -1 )
	
	' hexdec Tests
	Print "~nhexdec examples"
	
	Print "~nExample 1"
	Print "A: " + hexdec("See")
	Print "B: " + hexdec("ee")
	
	Print "~nC: " + hexdec("that")
	Print "D: " + hexdec("a0")
	
	' str_repeat Tests
	Print "~nstr_repeat examples"
	
	Print "~nExample 1"
	Print "A: " + str_repeat("-=", 10)
	
	Print "~nExample (NRG)"
	Print "B: " + str_repeat("-=", 0)
	Print "C: " + str_repeat("-=", 1)
	
	
	' Count Tests
	Print "~ncount"
	
	Local a:Int[] = New Int[3]
	a[0] = 1
	a[1] = 3
	a[2] = 5
	Print "~nA: " + count( a )
	Local b:String[] = New String[11]
	b[0] = "7"
	b[5] = "9"
	b[10]= "11"
	Print "B: " + count( b )
	
	Return 0
End

